/*
 * @Description: 消费记录详情页面,api工具类
 * @Author: tao.xie
 * @Date: 2019-03-18 16:58:32
 * @Last Modified by: tao.xie
 * @Last Modified time: 2019-03-19 17:02:42
 */
import ajaxAsync from 'vue-xiaobu-utils'

/**
 *获取乘车记录账单详情
 *
 * @param {String} outTradeNo 外部交易编号
 * @returns
 */
async function getBusConsumeDetail(outTradeNo) {
  return ajaxAsync('/vcard/bus_consume/detail', { OUT_TRADE_NO: outTradeNo })
}

/**
 *获取APP充值记录账单详情
 *
 * @param {String} outTradeNo
 * @returns
 */
async function getAPPRechargeDetail(outTradeNo) {
  return ajaxAsync('/vcard/app_recharge/detail', { OUT_TRADE_NO: outTradeNo })
}

/**
 *获取卡退款记录详情、充值提现记录详情
 *
 * @param {*} tradeNo
 */
async function getRefundAndReturnDetail(tradeNo) {
  return ajaxAsync('/vcard/refund/detail', { TRADE_NO: tradeNo })
}

/**
 *获取福利详情
 *
 * @param {*} outTradeNo
 * @returns
 */
async function getBenifitRechargeDetail(outTradeNo) {
  return ajaxAsync('/vcard/benifit_recharge/detail', {
    OUT_TRADE_NO: outTradeNo
  })
}

/**
 *获取员工订餐详情
 *
 * @param {*} outTradeNo
 * @param {*} type
 */
async function getMealConsumeDetail(outTradeNo, type) {
  return ajaxAsync('/vcard/meal_consume/detail', {
    OUT_TRADE_NO: outTradeNo,
    TYPE: type
  })
}

/**
 *获取线下消费详情
 *
 * @param {*} outTradeNo
 * @returns
 */
async function getOfflineConsumeDetail(outTradeNo) {
  return ajaxAsync('/vcard/offline_consume/detail', {
    OUT_TRADE_NO: outTradeNo
  })
}

/**
 *获取线上消费详情
 *
 * @param {*} outTradeNo
 * @returns
 */
async function getOnlineConsumeDetail(outTradeNo) {
  return ajaxAsync('/vcard/online_consume/detail', {
    OUT_TRADE_NO: outTradeNo
  })
}

export {
  getBusConsumeDetail,
  getAPPRechargeDetail,
  getRefundAndReturnDetail,
  getBenifitRechargeDetail,
  getMealConsumeDetail,
  getOfflineConsumeDetail,
  getOnlineConsumeDetail
}
